package com.karst.webnotes.chapter03
{
	import flash.events.Event;
	
	import org.aswing.AsWingManager;
	import org.papervision3d.objects.primitives.Plane;
	import org.papervision3d.view.BasicView;
	
	internal class VerticeExample extends BasicView
	{
		public function VerticeExample()
		{
			super() ;
			AsWingManager.getStage().frameRate = 40 ;
			createView() ;
			startRendering() ;
		}

		private var num : uint = 0 ;
		private var plane : Plane = null ;
		private function createView() : void
		{
			if( plane == null )
				plane = new Plane( null, 300, 300, 1, 1 ) ;
			scene.addChild( plane ) ;
		}
		
		override protected function onRenderTick(event:Event=null):void
		{
			super.onRenderTick( event ) ;
			num = plane.geometry.vertices.length ;
			for( var i : uint = 0 ;i < num ; i++ )
			{
				trace( "x:" + plane.geometry.vertices[i].x,
					"y:" + plane.geometry.vertices[i].y,
					"z:" + plane.geometry.vertices[i].z ) ;
			}
		}
	}
}